class Solution:
    def canBeTypedWords(self, text: str, brokenLetters: str) -> int:
        broken = set(brokenLetters)
        ans = 0
        for word in text.split(" "):
            for ch in word:
                if ch in broken:
                    break
            else:
                ans += 1
        return ans


if __name__ == "__main__":
    print(Solution().canBeTypedWords(text="hello world", brokenLetters="ad"))  # 1
    print(Solution().canBeTypedWords(text="leet code", brokenLetters="lt"))  # 1
    print(Solution().canBeTypedWords(text="leet code", brokenLetters="e"))  # 0
